package com.dragonsky.shop.openfeign.user;

import com.dragonsky.shop.common.utils.AjaxResult;
import com.dragonsky.shop.openfeign.user.param.UserInfoParam;
import com.dragonsky.shop.openfeign.user.vo.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "dragonShop-user", path = "/userFeign")
public interface UserFeign {

    @GetMapping("/userName")
    AjaxResult<String> userName(@RequestParam("userName") String userName);

    @GetMapping("/userInfo")
    AjaxResult<UserInfoVo> userInfo(@SpringQueryMap UserInfoParam userInfoParam);

    @PostMapping(value = "/userInfo2", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    AjaxResult<UserInfoVo> userInfo2(UserInfoParam userInfoParam);

    @PostMapping("/userInfo3")
    AjaxResult<UserInfoVo> userInfo3(@RequestBody UserInfoParam userInfoParam);

}
